# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Orson Teodoro <orsonteodoro@hotmail.com>
# Maintainer: Orson Teodoro <orsonteodoro@hotmail.com>
pkgname=surf
pkgver=2.0
pkgrel=0
pkgdesc="surf is a simple web browser based on WebKit2/GTK+."
url="https://surf.suckless.org/"
arch="all !mips !mips64" # blocked by webkit2gtk-dev
license="MIT"
depends="xprop"
makedepends="webkit2gtk-dev"
options="!check" # upstream doesn't have a test suite
source="$pkgname-$pkgver.tar.gz::https://dl.suckless.org/$pkgname/$pkgname-$pkgver.tar.gz"
builddir="$srcdir/"$pkgname-$pkgver
subpackages="$pkgname-doc"

prepare() {
	default_prepare
	sed -i -e '/CFLAGS/{s/-Os//;s/=/+=/}' \
		-e '/LDFLAGS/{s/-s//;s/=/+=/}' \
		"$builddir"/config.mk
}

build() {
	cd "$builddir"
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" PREFIX="/usr" install

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	install -m644 README TODO.md \
		"$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="75798bb189fa2c2c93827672089a86cf155aa7b5c7c1a0887a34817ca41763907e44a02f52947535d37a043f827d2c0fe75d16a3d172079f9cab8da341e4c0c5  surf-2.0.tar.gz"
